package cn.jiahua.test19;

import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;

public class Test {
    public static void main(String[] args) {
        //没有返回值的异步回调
        CompletableFuture<Void> completableFuture=CompletableFuture.runAsync(()->{

            System.out.println(Thread.currentThread().getName()+"runAsync   hello");

        });


        System.out.println("world");
//
//        try {
//            completableFuture.get();  //获取结果
//        } catch (InterruptedException e) {
//            e.printStackTrace();
//        } catch (ExecutionException e) {
//            e.printStackTrace();
//        }






        }
}
